package com.neouton.crm.op.entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.neouton.common.entity.BaseEntityVO;
import com.neouton.crm.customer.entity.CustomerVO;
import com.neouton.crm.entity.SysUserEntity;
import com.neouton.crm.payRecords.entity.PaymentRecords;
import com.neouton.crm.payRecords.entity.PaymentRequest;
import com.neouton.crm.paymentPlan.entity.PaymentPlan;
import com.neouton.crm.pm.entity.PurchaseOrderVO;
import com.neouton.crm.receiptRecords.entity.ReceiptRecords;
import com.neouton.crm.refundRecords.entity.RefundRecordsVO;
import com.neouton.crm.sales.entity.SalesFileRelationVO;
import com.neouton.encrypt.typehandler.Encrypt;
import lombok.Data;

/**
 * 机会表
 * @TableName sales_opportunity
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("sales_opportunity_view")
public class SalesOpportunityVO extends BaseEntityVO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 机会主键
     */
    private Integer opportunityId;

    /**
     * 机会编号
     */
    private String opportunityNumber;

    /**
     * 机会名称
     */
    private String opportunityTheme;

    /**
     * 客户id
     */
    private Integer customerId;

    // 客户名
    private String customerName;

    // 联系人
    private String customerContact;

    // 联系人电话
    private String customerPhone;

    /**
     * 客户需求
     */
    private String customerNeeds;

    /**
     * 关联客户表
     */
    private CustomerVO customer;

    /**
     * 发现时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp discoveryTime;

    /**
     * 所有者信息
     */
    private Integer owner;

    private String ownerName;

    private String ownerAccount;

    private String ownerDepts;
    /**
     * 预计签单日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp expectedSigningDate;

    /**
     * 合同总金额
     */
    private Encrypt expectedAmount;
    /**
     * 合同金额值
     */
    private String expectedAmountValue;

    /**
     * 金额外币备注
     */
    private String amountType;

    /**
     * 可能性
     */
    private Integer opportunityPossibility;

    /**
     * 可能性 %  百分比
     */
    private String opportunityPossibilityPercentage;

    /**
     * 状态
     */
    private Integer opportunityState;

    /**
     * 机会状态名
     */
    private String opportunityStateName;

    /**
     * 审核前状态
     */
    private Integer opportunityStateBack;

    /**
     * 抄送对象ID，逗号分隔
     */
    private String copyFor;

    /**
     * 抄送人姓名，逗号分隔，用于前端页面展示
     */
    private String copyForNames;

    /**
     * 当前工作流ID
     */
    private Integer businessId;

    /**
     * 审核状态
     */
    private Integer auditState;
    /**
     * 审核状态名
     */
    private String auditStateName;

    /**
     * 创建人信息
     */
    private String creatorName;

    private String creatorAccount;

    private String creatorDepts;

    /**
     * 修改者信息
     */
    private String modifierName;

    private String modifierAccount;

    private String modifierDepts;

    /**
     * 阶段状态id
     */
    private Integer stageStateId;

    /**
     * 阶段状态名
     */
    private String stageStateName;

    /**
     * 阶段备注
     */
    private String stageRemark;

    /**
     * 阶段变更时间
     */
    private Timestamp stageUpdateTime;

    /**
     * 当前阶段停留天数
     */
    private Integer stageStayTime;

    /**
     * 文件
     */
    private List<SalesFileRelationVO> messageFileRelation;

    /**
     * 文件id集
     */
    private List<String> fileIds;

    private Integer deleted;

    /**
     * 高级查询条件
     * 客户
     */
    private List<Integer> customerIds;

    /**
     * 所有者ID
     */
    private List<Integer> ownerIds;

    /**
     * 发现时间起点
     */
    private Timestamp discoveryTimeStart;

    /**
     * 发现时间结束
     */
    private Timestamp discoveryTimeEnd;

    /**
     * 预计签单日起点
     */
    private Timestamp expectedSigningDateStart;

    /**
     * 预计签单日结束
     */
    private Timestamp expectedSigningDateEnd;

    /**
     * 创建时间开始
     */
    private Timestamp createDataTimeStart;

    /**
     * 创建时间结束
     */
    private Timestamp createDataTimeEnd;

    /**
     * 阶段ID
     */
    private List<Integer> stageStateIds;
    /**
     * 阶段停留时间最小值
     */
    private Integer stageStayTimeMin;

    /**
     * 阶段停留时间最大值
     */
    private Integer stageStayTimeMax;

    /**
     * 机会可能性
     */
    private List<Integer> opportunityPossibilities;

    /**
     * 项目合同金额集合
     */
    private List<String> expectedAmountList;
    /**
     * 合同总金额最小值
     */
    private Encrypt expectedAmountMin;

    /**
     * 合同总金额最大值
     */
    private Encrypt expectedAmountMax;

    /**
     * 审核状态
     */
    private List<Integer> auditStates;

    /**
     * 机会状态
     */
    private List<Integer> opportunityStates;

    /**
     * 申请原因
     */
    private String reasonApplication;

    /**
     * 审批意见
     */
    private String processComments;


    /**
     * 审批主表ID
     */
    private Integer approvalId;
    private List<Integer> approvalList;

    /**
     * 机会创建审批主表ID
     */
    private Integer createApprovalId;


    /**
     * 前端排序标识
     */
    @TableField(exist = false)
    private String orderByColum;

    @TableField(exist = false)
    private String orderByProp;

    @TableField(exist = false)
    private String order;

    /**
     * 迁移状态0：未迁移 1：已迁移 2：迁移中
     */
    private Integer migrateState;

    /**
     * 所有事件
     */
    private List<Object> allThings = new ArrayList<>();

    /**
     * 采购单
     */
    private List<PurchaseOrderVO> purchaseOrders;

    /**
     * 内部采购单
     */
    private List<PurchaseOrderVO> inPurchaseOrders;

    /**
     * 付款计划
     */
    private List<PaymentPlan> paymentPlans;
    /**
     * 收票记录
     */
    private List<ReceiptRecords> receiptRecords;
    /**
     * 付款申请
     */
    private List<PaymentRequest> paymentRequests;

    /**
     * 付款记录
     */
    private List<PaymentRecords> paymentRecords;

    /**
     * 合同总金额 page
     */
    private String expectedAmountPage;
    /**
     * 合同总金额 total
     */
    private String expectedAmountTotal;

    private List<Integer> creatorList;

    /**
     * 合同表
     */
    private List<RefundRecordsVO> refundRecords;

    /**
     * 申请人
     */
    private Integer applicant;
    /**
     * 申请时间
     */
    private Timestamp applyTime;
    /**
     * 下一处理人
     */
    private Integer nextApprover;
    /**
     * 待办编号
     */
    private String approvalCode;

    private String askReason;

    private Integer isDelete;

    private String appReason;

    /**
     * 查询的类型名称，用于区分
     */
    private String typeName;

    /**
     * 转发人集合
     */
    private List<SysUserEntity> senderList;

    /**
     * 项目区分id
     */
    private Integer projectDifferentId;

    /**
     * 项目区分名称
     */
    private String projectDifferentName;

    /**
     * 项目类别
     */
    private Integer projectClasses;

    /**
     * 项目类别名称
     */
    private String projectClassesName;

    /**
     * 项目合同金额
     */
    private String projectExpectMoney;

    /**
     * 项目管理费用
     */
    private Encrypt projectManageMoney;

    /**
     * 立项时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp projectCreatetime;

    /**
     * 已回款金额
     */
    private String returnedMoney;
    private String returnedMoneyPage;
    private String returnedMoneyTotal;

    /**
     * 已开票金额
     */
    private String invoicedMoney;
    private String invoicedMoneyPage;
    private String invoicedMoneyTotal;

    /**
     * 已收票金额
     */
    private String collectTicketedMoney;
    private String collectTicketedMoneyPage;
    private String collectTicketedMoneyTotal;

    /**
     * 项目状态
     */
    private Integer projectState;

    /**
     * 项目状态名称
     */
    private String projectStateName;

    /**
     * 初验审批状态
     */
    private Integer approveStateFirst;

    /**
     * 初验审批状态名称
     */
    private String approveStateFirstName;

    /**
     * 初验审批状态
     */
    private Integer approveStateFirstId;

    /**
     * 初验审批状态
     */
    private Integer auditStateLastId;

    /**
     * 终验审批状态
     */
    private Integer auditStateLast;

    /**
     * 终验审批状态名称
     */
    private String auditStateLastName;

    /**
     * 项目类型
     */
    private Integer projectType;

    /**
     * 项目类型名称
     */
    private String projectTypeName;



    /**
     * 采购金额
     */
    private String purchaseMoney;



    /**
     * 项目管理费用 page
     */
    private String projectManageMoneyPage;
    /**
     * 项目管理费用 total
     */
    private String projectManageMoneyTotal;

    /**
     * 项目合同金额 page
     */
    private String projectExpectMoneyPage;
    /**
     * 项目合同金额 total
     */
    private String projectExpectMoneyTotal;

    /**
     * 已付款金额
     */
    private String paymentedMoney;
    private String paymentedMoneyPage;
    private String paymentedMoneyTotal;

    /**
     * 项目状态集合
     */
    private List<Integer> projectStateList;
    /**
     * 项目合同金额集合
     */
    private List<String> projectExpectMoneyList;
    /**
     * 立项时间集合
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private List<Timestamp> projectCreatetimeList;    /**
     * 立项时间始
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp projectCreatetimeStart;
    /**
     * 立项时间末
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp projectCreatetimeEnd;
    /**
     * 项目管理费用集合
     */
    private List<String> projectManageMoneyList;    /**
     * 项目管理费用小
     */
    private Encrypt projectManageMoneySmall;
    /**
     * 项目管理费用大
     */
    private Encrypt projectManageMoneyLarge;
    /**
     * 项目类别集合
     */
    private List<Integer> projectClassesList;
    /**
     * 项目类型集合
     */
    private List<Integer> projectTypeList;
    /**
     * 项目区分id集合
     */
    private List<Integer> projectDifferentIdList;
    /**
     * 审批状态集合
     */
    private List<Integer> approveStateList;
    /**
     * 审核状态集合
     */
    private List<Integer> auditStateList;

    /**
     * 项目合同金额小
     */
    private String projectExpectMoneySmall;
    /**
     * 项目合同金额大
     */
    private String projectExpectMoneyLarge;

    private Integer projectManageId;

    /**
     * 项目采购总额
     */

    private String purchaseMoneyPage;
    private String purchaseMoneyTotal;
    /**
     * 项目报销总额
     */
    private String reimburseMoney;
    private String reimburseMoneyPage;
    private String reimburseMoneyTotal;

    /**
     *  项目总额
     */
    private String projectMoney;
    private String projectMoneyPage;
    private String projectMoneyTotal;

    /**
     * 质保金额
     */
    private String warrantyDeposit;

    private String warrantyDepositPage;

    private String warrantyDepositTotal;

    /**
     * 是否有质保服务 1 有 0 无
     */
    private Integer warranty;

    /**
     * 是否有质保服务 1 有 0 无
     */
    private String warrantyName;

    /**
     * 退款总额
     */
    private String refundMoney;
    private String refundMoneyTotal;
    private String refundMoneyPage;

    /**
     * 已付总额
     */
    private String paymentMoney;
    /**
     * 人天服务
     */
    private String purchaseProductTotalPrice;
    /**
     * 质保服务
     */
    private String projectWarrantyDeposit;
    private String projectWarrantyDepositTotal;
    private String projectWarrantyDepositPage;


    private String internalPurchaseMoney;
    private String internalPurchaseMoneyTotal;
    private String internalPurchaseMoneyPage;


    /**
     * 实施利润
     */
    private String realTimeProfitMoney;

}
